package com.wyh.docker.service;

import com.wyh.docker.dao.StudentDao;
import com.wyh.docker.model.Student;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author wuyuhan
 * @date 2021/5/30 20:11
 */
@Service
public class StudentServiceImpl implements StudentService{
    @Resource
    private StudentDao studentDao;


    @Override
    public Object insert(Student student) {
        studentDao.insert(student);
        return "success";
    }


    @Override
    public Object delete(int id) {
        int ret = studentDao.delete(id);
        return ret>0?"success":"error";
    }


    @Override
    public Object update(Student student) {
        int ret = studentDao.update(student);
        return ret>0?"success":"error";
    }


    @Override
    public Student load(int id) {
        return studentDao.load(id);
    }

}
